package com.example.springboot.common;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;
import java.util.Map;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ResultCount {
    private String code;
    private boolean success;
    private Map<String, Object> data; // 可以添加更多字段来返回详细信息
    private boolean waterSufficient; // 新增字段，表示水量是否足够

    // 构造方法、getter和setter等

    public static ResultCount success(boolean waterSufficient) {
        ResultCount resultCount = new ResultCount();
        resultCount.setCode("200");
        resultCount.setSuccess(true);
        resultCount.setData(new HashMap<>());
        resultCount.setWaterSufficient(waterSufficient); // 设置水量是否足够
        return resultCount;
    }
}
